#[derive(RustcDecodable)]
struct Options {
- arg_pkgid: Option<String>,
arg_opts: Option<Vec<String>>,
- flag_profile: Option<String>,
+ flag_package: Option<String>,
flag_jobs: Option<u32>,
flag_features: Vec<String>,
flag_no_default_features: bool,
Compile a package and all of its dependencies
Usage:
- cargo rustc [options] [<pkgid>] [--] [<opts>...]
+ cargo rustc [options] [--] [<opts>...]
Options:
- -h, --help Print this message
- -p, --profile PROFILE The profile to compile for
- -j N, --jobs N The number of jobs to run in parallel
- --lib Build only this package's library
- --bin NAME Build only the specified binary
- --example NAME Build only the specified example
- --test NAME Build only the specified test
- --bench NAME Build only the specified benchmark
- --release Build artifacts in release mode, with optimizations
- --features FEATURES Features to compile for the package
- --no-default-features Do not compile default features for the package
- --target TRIPLE Target triple which compiles will be for
- --manifest-path PATH Path to the manifest to fetch depednencies for
- -v, --verbose Use verbose output
+ -h, --help Print this message
+ -p SPEC, --package SPEC The profile to compile for
+ -j N, --jobs N The number of jobs to run in parallel
+ --lib Build only this package's library
+ --bin NAME Build only the specified binary
+ --example NAME Build only the specified example
+ --test NAME Build only the specified test
+ --bench NAME Build only the specified benchmark
+ --release Build artifacts in release mode, with optimizations
+ --features FEATURES Features to compile for the package
+ --no-default-features Do not compile default features for the package
+ --target TRIPLE Target triple which compiles will be for
+ --manifest-path PATH Path to the manifest to fetch depednencies for
+ -v, --verbose Use verbose output
The <pkgid> specified (defaults to the current package) will have all of its
dependencies compiled, and then the package itself will be compiled. This
config.shell().set_verbose(options.flag_verbose);
let root = try!(find_root_manifest_for_cwd(options.flag_manifest_path));
- let spec = options.arg_pkgid.as_ref().map(|s| &s[..]);
let opts = CompileOptions {
config: config,
target: options.flag_target.as_ref().map(|t| &t[..]),
features: &options.flag_features,
no_default_features: options.flag_no_default_features,
- spec: spec,
+ spec: options.flag_package.as_ref().map(|s| &s[..]),
exec_engine: None,
mode: ops::CompileMode::Build,
release: options.flag_release,
"#)
.file("src/lib.rs", r#" "#);
- assert_that(p.cargo_process("rustc").arg("--lib").arg("-v").arg("foo"),
+ assert_that(p.cargo_process("rustc").arg("--lib").arg("-v"),
execs()
.with_status(0)
.with_stdout(verbose_output_for_target(true, &p)));
"#)
.file("src/lib.rs", r#" "#);
- assert_that(p.cargo_process("rustc").arg("--lib").arg("-v").arg("foo")
+ assert_that(p.cargo_process("rustc").arg("--lib").arg("-v")
.arg("--").arg("-Z").arg("unstable-options"),
execs()
.with_status(0)
fn main() {}
"#);
- assert_that(p.cargo_process("rustc").arg("-v").arg("foo")
+ assert_that(p.cargo_process("rustc").arg("-v")
.arg("--").arg("-Z").arg("unstable-options"),
execs()
.with_status(0)